#pragma once

#include "Pipeline.h"
#include "aabb.h"

// Base class for every entity
class Entity {
public:
	inline Entity () : _need_draw(true), _need_unique_color(false) { updateAabb(); }
	inline void setXform (const Pipeline &xf) { _xform = xf; updateAabb(); }
	inline Matrix_4x4 &getFinalTransform () const { return _xform.getFinalTransform(); }
	inline const Vector3f &getTranslation () const { return _xform.getTranslation(); }

	inline bool needDraw () const { return _need_draw; }
	inline void needDraw (const bool need) const { _need_draw = need; }

	inline bool needUniqueColor () const { return _need_unique_color; }
	inline void needUniqueColor (const bool need) const { _need_unique_color = need; }

	inline const aabb &getAabb () const { return _aabb; }

private:
	// For one just hardcode - i should have a model class to get this info
	inline void updateAabb () {
		_aabb.setMin(Vector3f(-1.f, -1.f, -1.15475f));
		_aabb.setMax(Vector3f(1.f, 1.f, 0.5773f));
	}

private:
	mutable bool _need_draw;
	mutable bool _need_unique_color;
	aabb _aabb;
	Pipeline _xform;
};